Hi all, I have a module that collects together batches of requirements into "Features" (capabilities). The requirements are linked to the features from the requirements module. The Requirements module, contains an attribute for "Change Requests" that affect a requirement. I want to be able to show a list of CRs that affect each feature from the features module. I have tried to write some layout DXL to display only unqiue references to CRs (as using the trace wizard I get loads of duplicate CR references displayed as a CR can effect more than one requirement). However, It does not seem to work. Just wondering if anyone can spot any glaring errors.
Link outgoinglink
Thanks,
Alex AlexBeach - Thu Aug 29 06:19:02 EDT 2013 |
Re: Unique string value processing from links Hi Alex, I noticed a couple of things:
s = targetreqobj."NTIS Change Reference" Should the i++ be in the duplicate==false section instead of outside the for loop? Otherwise, your incrementing the index for every link instead of incrementing every time you add a new value to the array. The assumption here is that "NTIS Change Reference" will only contain a single value. We have a list of CRs in a similar attribute. The other assumption is that your target module is open. Hope this helps a little, Greg |
Re: Unique string value processing from links if the requirement value for "NTIS Change Reference" may contain only a single CR reference, then you can let the native "Skip" feature to ignore duplicates:
After your link loop:
if a requirement may have more than one CR, then you'll need to parse the value separated by delimiters (?comma space?) and put each delimited value in the Skip. -Louie Greg is right, you have a "i" logical problem in what you have written. Move "i++" right after the "put" (or merge them: <put(a, s, i++, 0)>>), and I think "Count < i" instead of "<=". But I suggest you get rid of all that. Greg is slightly wrong here: <<s = targetreqobj."NTIS Change Reference">> is correct. "o.Name" is indeed a variable of type "Attr__" and specifically is NOT the retrieved value. However, "string = o.Name" specifically retrieves the value and stores in the string; I think the only time it auto-retrieves. You would need to convert the "Attr__" into a retrieved value when it is not the only thing on the right side of an equal sign: <<if (o.Name "" != "") then...>> When you "concatenate" an "Attr__" with a string, it means retrieve then concatenate: <<o.Name "">>
|
Re: Unique string value processing from links llandale - Thu Aug 29 12:31:12 EDT 2013 if the requirement value for "NTIS Change Reference" may contain only a single CR reference, then you can let the native "Skip" feature to ignore duplicates:
After your link loop:
if a requirement may have more than one CR, then you'll need to parse the value separated by delimiters (?comma space?) and put each delimited value in the Skip. -Louie Greg is right, you have a "i" logical problem in what you have written. Move "i++" right after the "put" (or merge them: <put(a, s, i++, 0)>>), and I think "Count < i" instead of "<=". But I suggest you get rid of all that. Greg is slightly wrong here: <<s = targetreqobj."NTIS Change Reference">> is correct. "o.Name" is indeed a variable of type "Attr__" and specifically is NOT the retrieved value. However, "string = o.Name" specifically retrieves the value and stores in the string; I think the only time it auto-retrieves. You would need to convert the "Attr__" into a retrieved value when it is not the only thing on the right side of an equal sign: <<if (o.Name "" != "") then...>> When you "concatenate" an "Attr__" with a string, it means retrieve then concatenate: <<o.Name "">>
Hi all, Thanks for the replies. It sort of worked as is, by luck more than anything. However, (as you both pointed out) the reason I thought it didn't work is because the CR attribute can have more than one CR in it. These are separated by <<carridge returns>>. How do I parse a value for a <<carridge return>>? Count <= i was definiately a problem. I have moved the i++ too. Thanks for that.
Just got the skip list stuff working too. Now to figure out the parsing.
Thanks again. |
Re: Unique string value processing from links AlexBeach - Fri Aug 30 03:22:06 EDT 2013 Hi all, Thanks for the replies. It sort of worked as is, by luck more than anything. However, (as you both pointed out) the reason I thought it didn't work is because the CR attribute can have more than one CR in it. These are separated by <<carridge returns>>. How do I parse a value for a <<carridge return>>? Count <= i was definiately a problem. I have moved the i++ too. Thanks for that.
Just got the skip list stuff working too. Now to figure out the parsing.
Thanks again.
-Louie |